package com.neiquan.weiguan.fragment;

import android.view.LayoutInflater;
import android.view.View;

import com.neiquan.weiguan.R;
import com.neiquan.weiguan.appliction.MyApplication;
import com.neiquan.weiguan.colorful.Colorful;
import com.neiquan.weiguan.fragment.base.AppBaseFragment;
import com.neiquan.weiguan.utils.Constant;

import net.neiquan.applibrary.utils.LogC;

import org.haitao.common.utils.SharedPreferencesUtil;

import butterknife.ButterKnife;

/**
 * Created by wyl on 2016/6/20.
 */
public class NewsFragment extends AppBaseFragment {
    @Override
    public View initRootView() {
        View view = LayoutInflater.from(getActivity()).inflate(R.layout.news_fragment, null);
        ButterKnife.inject(this, view);
        return view;
    }

    @Override
    public void setViews() {
        setupColorful();
    }

    @Override
    public void initData() {

    }

    @Override
    protected void setupColorful() {
        colorful = new Colorful.Builder(this)
                .textColor(R.id.item_textview, R.attr.text_color)
                .create();
    }

    @Override
    protected void onBroadcastListener() {
        boolean isday = SharedPreferencesUtil.getBoolean(MyApplication.getInstance(), Constant.SHAREDPREFERENCES_ISDAY);
        LogC.i("aaaaa","isday+++++++++++"+isday);
        if (isday) {
            colorful.setTheme(R.style.DayTheme);
        } else {
            colorful.setTheme(R.style.NightTheme);
        }
    }
}
